package javaScripts;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


/**
 * Created by lomo on 2017/7/19.
 */
public class getHybridPackagesMD5 {

    public static void main(String ... args) throws Exception {

        //String filePath = "/Users/lomo/Downloads/userMoreInformation";

        //String testfile = "/Users/lomo/Downloads/userMoreInformation.zip";
        //File root = new File(testfile);
        //System.out.print(caculateFileMD5(root)); //402d3d3ef4716fc0a0db88e2ab9a3ee6

        /*
        ArrayList<String> s = getFiles(filePath);
        //s.add("/Users/lomo/Downloads/userMoreInformation/views/torkR.html");
        sortPathList(s);
        for(String t:s)
        {
            System.out.println("文件：" + t + "的MD5值为：" + calculateFileMD5(t));
        }
        */

        //ArrayList<String > s = getFileMD5List(filePath);
        //System.out.println(s);

        //md5 -s "lomo" => 91cdf12ba5922776a6e518e17a45b871
        //System.out.println(MD5Utils.getMd5("lomo"));

        long startTime = System.currentTimeMillis();    //获取开始时间
        //long startTime=System.nanoTime(); //纳秒


        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //java.io.InputStreamReader继承了Reader类
        String read = null;

        System.out.println("----------------------------------------------------------");
        System.out.print("输入解压后的文件夹地址(绝对路径): ");
        try {
            read = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("输入的文件夹地址为: "+read);

        System.out.println("\r\n该Hybrid文件夹MD5值为: " + traversalFileMd5.getPackagesMD5(read));

        long endTime = System.currentTimeMillis();    //获取结束时间
        //long endTime=System.nanoTime();

        System.out.println("【共耗时：" + (endTime - startTime) + "ms】");    //输出程序运行时间

        //System.out.println("Test：" + MD5Utils.calculateFileMD5("/Users/lomo/Downloads/enterpriseLoanDetail/views/extendTermWhat.html"));

        //System.out.println("\r\n New_est：" + MD5Utils.getFileMD5("/Users/lomo/Downloads/enterpriseLoanDetail/views/extendTermWhat.html"));

    }
}
